<?php
/**
 * Created by PhpStorm.
 * User: renyi
 * Date: 2017/10/13
 * Time: 上午3:14
 */

namespace App\Core;


trait CommonPoolMethod
{
    // --------------------------------------------------------------------------------------------
    // 快捷方法
    // --------------------------------------------------------------------------------------------

    protected function service($name)
    {
        return CommonPool::instance()->createService($name);
    }

    protected function dao($name)
    {
        return CommonPool::instance()->createDao($name);
    }

    protected function talk($name)
    {
        return CommonPool::instance()->createTalk($name);
    }

    protected function scene($name)
    {
        return CommonPool::instance()->createScene($name);
    }

    protected function stat($name)
    {
        return CommonPool::instance()->createStat($name);
    }

    protected function remember($key, $value)
    {
        CommonPool::instance()->saveParams($key, $value);
    }

    protected function recall($key)
    {
        return CommonPool::instance()->getParams($key);
    }

    protected function forget($key)
    {
        CommonPool::instance()->removeParams($key);
    }
}